﻿@{
    ViewBag.Title = "Index";
}
@section Scripts{
<script src="~/Scripts/plugins/bootstrap.min.js"></script>
<script src="~/Scripts/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="~/Scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <script src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script src="~/Scripts/sys/lib/common_raw.js"></script>
    <script type="text/javascript">
        function initAcTable() {
            $('#acc_tb').bootstrapTable('destroy');
            common.initAcTable("acc_tb", "toolbar", "post", "getAgencyRobots.html",
                function (data) {
                    if (!data.State) {
                        common.msg(data.Message, 1);
                    }
                },
                function (e) { },
                true, true, false, 10, 1, "[10,20,30,50]", { account: $("#account").val(), content: $("#content").val() });
        }

        $(document).ready(function () {
            initAcTable();

            $("#search").bind("click", function () {
                alert(1);
                var load_index3 = layer.load(0, { shade: 0.6 });

                initAcTable();
                layer.close(load_index3);
            });
        });

        function operateFormatter(index, row) {


 

         
var html =" <a href=\"javascript:Edit("+ row.Id +")\" class=\"table-link\"><span class=\"fa-stack\"><i class=\"fa fa-square fa-stack-2x\"></i><i class=\"fa fa-pencil fa-stack-1x fa-inverse\"></i></span></a>";
            
html += "  <a href=\"javascript:Delete(" + row.Id + ")\" class=\"table-link danger\"><span class=\"fa-stack\"><i class=\"fa fa-square fa-stack-2x\"></i><i class=\"fa fa-trash-o fa-stack-1x fa-inverse\"></i></span></a>";

            return html;
        }

        function Delete(id) {

            if (!confirm("确定删除吗？"))
            {
                return false;
            }

            common.invokeApi(
                      "post",
                      "/deleteAgencyRobot.html?id="+id,
                      { id: id},
                      function () { },
                      function (data) {
                          common.msg(data.Message, 1, function () {
                              $(".md-close").trigger("click");

                              initAcTable();
                          });
                      },
                      function (data) {
                          common.msg(data.Message, 2, function () { });
                      },
                      function () { }
                      );




          //  window.location.href = '/editAgencyUser.html?id=' + id;
        }

        function Edit(id) {
            //iframe层
            //parengPanel = layer.open({
            //    type: 2,
            //    title: '编辑【' + username + '】',
            //    shadeClose: false,
            //    shade: 0.8,
            //    area: ['70%', '50%'],
            //    content: '/editUser.html?id=' + id
            //});
            window.location.href = '/editAgencyRobot.html?id=' + id;
        }


    </script>
}



<div class="row" style="opacity: 1;">

        <div class="row">
            <div class="col-lg-12">
                <ol class="breadcrumb">
                    <li><a href="#">首页</a></li>
                    <li class="active"><span>代理设置</span></li>
                </ol>
                <div class="clearfix">
                    <h1 class="pull-left">代理数据绑定 </h1>
                    <div class="pull-right top-page-ui">
                        <a href="/editAgencyRobot.html" class="btn btn-primary pull-right">
                            <i class="fa fa-plus-circle fa-lg"></i> 新增绑定
                        </a>
                    </div>
                </div>
                </div>
        </div>
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="main-box clearfix">
                    <header class="main-box-header clearfix">
                        <h2 class="pull-left">代理绑定信息</h2>
                        <div class="filter-block pull-right" id="toolbar">
                            <div class="form-group pull-left">
                                <input type="text" class="form-control" placeholder="搜索账号" name="account" id="account">
                                 
                            </div>
                            <div class="form-group pull-left">
                                <input type="text" class="form-control" placeholder="搜索内容" name="content" id="content">
                                
                            </div>
                            <button type="button" class="btn btn-s btn-primary" id="search">搜索</button>
                            @*<a href="/editAgencyRobot.html" class="btn btn-primary pull-right">
                                    <i class="fa fa-plus-circle fa-lg"></i> 新增绑定
                                </a>*@
                        </div>
                    </header>
                    <div class="main-box-body clearfix">
                        <div class="table-responsive">
                            <table class="table" @*data-toggle="table"*@ id="acc_tb" data-pagination="true">
                                <thead>
                                    <tr>
                                        <th data-field="FlockType" data-align="center">类型</th>
                                        <th data-field="AU_Name" data-align="center">账号</th>
                                        <th data-field="FlockName" data-align="center">内容</th>
                                        <th class="text-center" data-formatter="operateFormatter">操作</th>
                                        <th>&nbsp;</th>
                                    </tr>
                                </thead>
                                @*<tbody>
                                        <tr>
                                            <td>
                                                iPad Mini 32GB Wifi
                                            </td>
                                            <td class="text-right">
                                                $ 625.50
                                            </td>
                                            <td class="text-center">
                                                <span class="label label-warning">Inactive</span>
                                            </td>
                                            <td class="text-center">
                                                2013/08/08 12:08
                                            </td>
                                            <td style="width: 15%;">
                                                <a href="#" class="table-link">
                                                    <span class="fa-stack">
                                                        <i class="fa fa-square fa-stack-2x"></i>
                                                        <i class="fa fa-search-plus fa-stack-1x fa-inverse"></i>
                                                    </span>
                                                </a>
                                                <a href="#" class="table-link">
                                                    <span class="fa-stack">
                                                        <i class="fa fa-square fa-stack-2x"></i>
                                                        <i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
                                                    </span>
                                                </a>
                                                <a href="#" class="table-link danger">
                                                    <span class="fa-stack">
                                                        <i class="fa fa-square fa-stack-2x"></i>
                                                        <i class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
                                                    </span>
                                                </a>
                                            </td>
                                        </tr>

                                    </tbody>*@
                            </table>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>